UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OVBZajvIP7p0d17ynVn8OdTleCammHwUfANG5jk4j1A='
WHERE
key_id = '22190f835a17d2687a6086ced1d25abe0dab53d26201bf2f5c331c5a94bcbf06'
AND (
token = 'OVBZajvIP7p0d17ynVn8OdTleCammHwUfANG5jk4j1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)