UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ODZtmLIP/3eoyLD3soUTZLMIyEXhtYJJA9cgXqpbd3w=' 
WHERE 
  key_id = '957a65b6769d2c6585706108b73fcf52463e206b7bf045312a99cfdce4fcc6e1' 
  AND (
    token = 'ODZtmLIP/3eoyLD3soUTZLMIyEXhtYJJA9cgXqpbd3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017