UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZUmrSMymoiq3Y4teu1eXGZPY8gAzcti96v2bCokrzbs=' 
WHERE 
  key_id = '26bdd401f064972d0f6c3e9948a25d066ad1613cf10b93e865b37a1221c08880' 
  AND (
    token = 'ZUmrSMymoiq3Y4teu1eXGZPY8gAzcti96v2bCokrzbs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044