UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1BtZ3CYzWNkGbnXvR75+YqKxRVVGdof9Wp887N1s33g='
WHERE
key_id = 'c0ef0dbac1b6a6732d0cde27ed3d3fa8af5a7f64e8e3e1988cd4d7ce758a0d64'
AND (
token = '1BtZ3CYzWNkGbnXvR75+YqKxRVVGdof9Wp887N1s33g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)