UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ud9b1xSwjPF+j7sTezwtw6hZh2Q+PzUGjYgb3K3FmMk='
WHERE
key_id = '00d84582aa3afbadf87676be93c982535a826ff12a9dbd23966bef2e6069da00'
AND (
token = 'Ud9b1xSwjPF+j7sTezwtw6hZh2Q+PzUGjYgb3K3FmMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)