UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uw0TPzb4S9LT1afyMnWBWicx646nZV6n8HAJuvSKZgY='
WHERE
key_id = 'aaa241f066ff323e9c1427feb8ae62b0f95f8c91fc266909d58f99479526c630'
AND (
token = 'Uw0TPzb4S9LT1afyMnWBWicx646nZV6n8HAJuvSKZgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)