UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VD5/fJWjviuP/EZkTjg8UY/MLEjYjdFAGUt5bGfMpSM='
WHERE
key_id = '0fd381fb5659ff27f7bc8974a984e437a6ee92026b13f4cc53019d78ca0aac69'
AND (
token = 'VD5/fJWjviuP/EZkTjg8UY/MLEjYjdFAGUt5bGfMpSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)