UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uU/qJMT004OKwcTJ+M/l69HpqDVOHMrliaw81iG1Uq8=' 
WHERE 
  key_id = 'ef65a685bb11c0058a1aeaf9039d0c9b9ed05e46908fd425e2b33b47779a4d20' 
  AND (
    token = 'uU/qJMT004OKwcTJ+M/l69HpqDVOHMrliaw81iG1Uq8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028