UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'phpOXdKIiWpS1ejXFPSuPrzc0VjUmHCSWoZ6WTdmNjY='
WHERE
key_id = 'b8f3551827833a7f7a98f82b542dc8001fee8102060360b5f7691ce36912d614'
AND (
token = 'phpOXdKIiWpS1ejXFPSuPrzc0VjUmHCSWoZ6WTdmNjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)