UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mCU+pMETMm6a8cd4bDh2cnbOlhOB7hogx8HzB0g3W0I='
WHERE
key_id = 'e7a3134a9d8faec0a5becfc3d4ee3da60899d59da99a5c7c34ea03a8035e431a'
AND (
token = 'mCU+pMETMm6a8cd4bDh2cnbOlhOB7hogx8HzB0g3W0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)