UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tMpz8Yv4eH4Tc8C+j3njl7FschpxLjh/zhje2anO0l0='
WHERE
key_id = '65a315ca85a1ffb625636e1e2c71b952c979bdcd9d12b25ab38fae7e2cfa3b94'
AND (
token = 'tMpz8Yv4eH4Tc8C+j3njl7FschpxLjh/zhje2anO0l0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)