UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OHTjtMh37kie/y18rwBDyEYmFxku+eAZZRSpf1/7hP4='
WHERE
key_id = '111c5ef990ecd78d26633528332ab3d6856317b006fbd562886ebe2e3f1d06a4'
AND (
token = 'OHTjtMh37kie/y18rwBDyEYmFxku+eAZZRSpf1/7hP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)