UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v4lqtomVn2HHTzCdLeZYs5sPJo55Q3Hw/B6lILX/QtU='
WHERE
key_id = 'f727b30c1a8a306f716ed169968db0ceb2785519cd4e705d6df8cce3e8355cba'
AND (
token = 'v4lqtomVn2HHTzCdLeZYs5sPJo55Q3Hw/B6lILX/QtU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)