UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/oJAQdVdxAH5wV8dihdfADqdN4yHEqFwH1+PSOvBuGA='
WHERE
key_id = 'bdad63261aecc7b85657793a9992e69d0f8f646abc7f32e3ce5d6ec50e68ad57'
AND (
token = '/oJAQdVdxAH5wV8dihdfADqdN4yHEqFwH1+PSOvBuGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)