UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+nwTbNg9TkTSfSuLEi6dtr9eE0Bi0wCLfv3rOQ8Ow/8=' 
WHERE 
  key_id = '8430a4423b989f433b4d0746f11044338f9253ec3ff46a89f71fd892c8cc44b9' 
  AND (
    token = '+nwTbNg9TkTSfSuLEi6dtr9eE0Bi0wCLfv3rOQ8Ow/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022