UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bEC/Nw58grqz9+uZ9BRsxcMhKLKEdbR2NdRPuUctxos='
WHERE
key_id = 'c99a7c7de6ee07502ae8a157c5caf3624dfd3e02c0e226867d96b6c4b424db3f'
AND (
token = 'bEC/Nw58grqz9+uZ9BRsxcMhKLKEdbR2NdRPuUctxos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)