UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MIK5j1QTVmgrKYrOtA/cSy+3Wyr7bbJBPR2ZRbYdCac=' 
WHERE 
  key_id = 'fa5eab0637f6af6254e2961629dd6696742fe8ef344710bca668bbf562a37fd4' 
  AND (
    token = 'MIK5j1QTVmgrKYrOtA/cSy+3Wyr7bbJBPR2ZRbYdCac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043