UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JtUwYY4tPcysrE0g3A4ml9yb3RjnUM/NP4lggq/e8HM=' 
WHERE 
  key_id = '225c7711b7da5cc5ad6a92244d7e13581d57e11421454ceccbf37bcdd9d5603f' 
  AND (
    token = 'JtUwYY4tPcysrE0g3A4ml9yb3RjnUM/NP4lggq/e8HM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019