UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M6awJRkDFmLZqvH41FvlTUufeOW9yqmJyWD4GzlVJvw='
WHERE
key_id = '5fb672c21bc34a77f40a7f221765460bc0afb2ed019c3a499d1b95b2a2fd7689'
AND (
token = 'M6awJRkDFmLZqvH41FvlTUufeOW9yqmJyWD4GzlVJvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)