UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qm+sYBJhLCQ3CU2atpq69hqrLwcvl53IvZfgaxbpHUw=' 
WHERE 
  key_id = '55ae454c2041c23a58a1a51c3873497667d57ecc0876021f83284ad4475f20f0' 
  AND (
    token = 'Qm+sYBJhLCQ3CU2atpq69hqrLwcvl53IvZfgaxbpHUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027