UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VAtkXFyDg4lPfIAocRpXDK6SnnDVVXFLSm5HxmGOnus=' 
WHERE 
  key_id = '766e0c6b31f6ddf59da81c482c8672cc1c67e0931be3cfefdc59220f22eaec67' 
  AND (
    token = 'VAtkXFyDg4lPfIAocRpXDK6SnnDVVXFLSm5HxmGOnus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049