UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E9NVpGh46kr0MrHImMNZ8sSVsZMY/WeVlR+7yEbVGgA='
WHERE
key_id = 'f7daa93d2cf98daeaa41ad29276088c432b93b4952d3c8b5a693eab59f67141c'
AND (
token = 'E9NVpGh46kr0MrHImMNZ8sSVsZMY/WeVlR+7yEbVGgA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)