UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0g6mRjj8TBmPbRqJbVZgiRq2XrWxzlwrGLEsJYJoISk='
WHERE
key_id = '83263b4cfbd32262602b6932fd50ade7a6340bc4204456d2bc3f3406fdc21999'
AND (
token = '0g6mRjj8TBmPbRqJbVZgiRq2XrWxzlwrGLEsJYJoISk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)