UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yoUh9jubLD2ljeX3PAnqbitTc5Ron/KmyOw/F3gSy44='
WHERE
key_id = 'ff38c4a355b618f5d3157699a044d835958971831074af7f786db326c4fc8989'
AND (
token = 'yoUh9jubLD2ljeX3PAnqbitTc5Ron/KmyOw/F3gSy44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)