UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fiHGV+4FrKHp9k4LdLKDJlPmEh0u2NkLB7vUCmtH3oU=' 
WHERE 
  key_id = 'd0c88a4ea1175cb2fb8f491107332d4a9bb8b7dddff383eff04562b6363384d0' 
  AND (
    token = 'fiHGV+4FrKHp9k4LdLKDJlPmEh0u2NkLB7vUCmtH3oU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022