UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nCs9AZLIIplyRiLgTu8mul1o6UUegkEvEF1I/qBcN6I=' 
WHERE 
  key_id = '3e33f919f990423d0c49fe8e40125744cb65a404fb6d37296408796ab8fcb851' 
  AND (
    token = 'nCs9AZLIIplyRiLgTu8mul1o6UUegkEvEF1I/qBcN6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086