UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/HwzgnpmTb5DxM0RvAdRNMMk6AIatu4GZfmXAewW4Qs=' 
WHERE 
  key_id = 'c18849b3db28bcb21ade514f91c2c586034a6c5490e9e402e4dd6ef650402f8e' 
  AND (
    token = '/HwzgnpmTb5DxM0RvAdRNMMk6AIatu4GZfmXAewW4Qs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043