UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4NYzxjlziJUkw4yP0tLay6LgpSDObKK0VVuC3JoKfac='
WHERE
key_id = 'f8ac470132db3dd91ea61992270926aa55597d988a83b8bb1d8503e30fe0a25a'
AND (
token = '4NYzxjlziJUkw4yP0tLay6LgpSDObKK0VVuC3JoKfac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)