UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NrSW3zHP1jBWvjQaSWVTZrMrnz2Uyq3AZKOY2fzuiyE='
WHERE
key_id = '295b811628cd44af33a8bbf33c522bea03900cdad7f3a81cf162ec0d0140001f'
AND (
token = 'NrSW3zHP1jBWvjQaSWVTZrMrnz2Uyq3AZKOY2fzuiyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)