UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2bWkB1mzVOvX3gfirAzpM94VMcZxIHdTfVI82J72UlA='
WHERE
key_id = '4857dc3492e4f22afe163bf3ba3fa1c3a51015728202663f7f22c6e1cbe629a1'
AND (
token = '2bWkB1mzVOvX3gfirAzpM94VMcZxIHdTfVI82J72UlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)