UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZMnL2aV0XBN4IeC0ObEPZAFq+vgsKuSDKQ/+vHvBrZQ='
WHERE
key_id = 'c672efba88df39470e9be38dfb1154f0054b5734a81ee19664898afbd4b25602'
AND (
token = 'ZMnL2aV0XBN4IeC0ObEPZAFq+vgsKuSDKQ/+vHvBrZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)