UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OI/npO/nK4foGKPO+nhDVFYoDKVF0L3dKtJGWGDXC/s='
WHERE
key_id = '99331c73652a1214f8cc42a21ee8b6a9c908fa1a413ce21ca2b281dbe650a3dd'
AND (
token = 'OI/npO/nK4foGKPO+nhDVFYoDKVF0L3dKtJGWGDXC/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)