UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D5hAR+ach9mWrZohdMdWMUKM1Yz2fYJteFxnWEpftZI=' 
WHERE 
  key_id = 'efae3bd3aafd08c5bfda2b032eb9ca7a9bb9b032d8743ca98be630206e1f51d6' 
  AND (
    token = 'D5hAR+ach9mWrZohdMdWMUKM1Yz2fYJteFxnWEpftZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040