UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vYer2EQDc/kWWbmFIj0f/sbkGWeB/jOOt/WLxlHAf8w='
WHERE
key_id = '717a694ece2a244546f6cac78e60951c734f6ecdb0f59846a907ee764975fa6e'
AND (
token = 'vYer2EQDc/kWWbmFIj0f/sbkGWeB/jOOt/WLxlHAf8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)