UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KlnD+CWqLzBl/orMmgdUVJ5ITivFt4Uh2Jukbt/X1ic=' 
WHERE 
  key_id = 'dadeaf15018ca6cc94f5ddb5f982e865accca2ec03cc783cdcb27bdfd40db5a2' 
  AND (
    token = 'KlnD+CWqLzBl/orMmgdUVJ5ITivFt4Uh2Jukbt/X1ic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021