UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CegAttxxBbOhQ9TF7icLIhfrZpxQrgSm5PGIHG3wG6k=' 
WHERE 
  key_id = '85dedc1cfc247e41b9c238ddf818bca50694768fd0c77390c53d943c4f7e0dbf' 
  AND (
    token = 'CegAttxxBbOhQ9TF7icLIhfrZpxQrgSm5PGIHG3wG6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045