UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xKoZHE+8BCiTPBJykr2+v8O55WbmwvzZY9oQ6Xxxs8A='
WHERE
key_id = 'd68c108178f4877216ed05483dd325d4f9b7d9197c2cd21864105e7f930424ec'
AND (
token = 'xKoZHE+8BCiTPBJykr2+v8O55WbmwvzZY9oQ6Xxxs8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)