UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g/P9XkyyHJOHber/vXtP715wYYJ/GwoKOzd1TxYMQKA='
WHERE
key_id = '34fa68e5b46c5672a0103cccfe006f204000b867c9466189b829d33eb2e60705'
AND (
token = 'g/P9XkyyHJOHber/vXtP715wYYJ/GwoKOzd1TxYMQKA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)