UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JKwuJTE8sFe8l7ZeRwZowFDowagmgaKoqoeqlNfQW7g=' 
WHERE 
  key_id = '9337b7988982c5920de2ef475a2185e3246dd6ba44c3a02c01e9388d41661d7a' 
  AND (
    token = 'JKwuJTE8sFe8l7ZeRwZowFDowagmgaKoqoeqlNfQW7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028