UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8f0ZEL/dXEHK3R6KjSyrUiLoFnGk+si0LjQAhFujg8k='
WHERE
key_id = '6e67e81c4f5249e768174a52146f025b8db7d0344aa92138c6cd1d1d841efb6c'
AND (
token = '8f0ZEL/dXEHK3R6KjSyrUiLoFnGk+si0LjQAhFujg8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)