UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9GfGTw6SaWEG9lxpVw5YZp9gHyz4FDroZ/uCzx6sIFE='
WHERE
key_id = 'b51750a27efbb59ee60a99f7edea4609ac84017a920bad61e540187134d2f436'
AND (
token = '9GfGTw6SaWEG9lxpVw5YZp9gHyz4FDroZ/uCzx6sIFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)