UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gPxNC31+eyz4eQbWJO6ZIK4Z4lAYzOcwOEUqI1emkvk='
WHERE
key_id = '4888c4a760c90cdd4e92c366d3b3b2eba60d8ae0a503f77466897551d1e3da02'
AND (
token = 'gPxNC31+eyz4eQbWJO6ZIK4Z4lAYzOcwOEUqI1emkvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)