UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnVgwoOSkfTTo4b2O6glTUbGo3wUTuV+8sWmjuPONUw='
WHERE
key_id = 'b6c9da77fccc9ffc147ed33469e29efb4bd1935360bdc6cc97c5f51b69f59cb9'
AND (
token = 'HnVgwoOSkfTTo4b2O6glTUbGo3wUTuV+8sWmjuPONUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)